target=\
	test_util \
	test_except \
	test_config \
	test_level \
	test_message \
	test_format \
	test_sink \
	test_logger \
	test_server \
	test_api \
	test_bench \

cxx=g++
std=-std=c++11

all:$(target)

test_util:test_util.cc
	$(cxx) -o $@ $^ $(std)

test_except:test_except.cc
	$(cxx) -o $@ $^ $(std)

test_config:test_config.cc
	$(cxx) -o $@ $^ $(std)

test_level:test_level.cc
	$(cxx) -o $@ $^ $(std)

test_message:test_message.cc
	$(cxx) -o $@ $^ $(std)

test_format:test_format.cc
	$(cxx) -o $@ $^ $(std)

test_sink:test_sink.cc
	$(cxx) -o $@ $^ $(std)

test_logger:test_logger.cc
	$(cxx) -o $@ $^ $(std) -g

test_bench:test_bench.cc
	$(cxx) -o $@ $^ $(std)

test_server:test_server.cc
	$(cxx) -o $@ $^ $(std)

test_api:test_api.cc
	$(cxx) -o $@ $^ $(std)


.PHONY:clean towin tolinux

lnx_user=yyx
lnx_addr=47.101.68.49
win_user=w3395
win_addr=192.168.2.14
src=~/Project/easylog
lnx_dst=/home/yyx
win_dst=D:\\

clean:
	rm -f $(target)

towin:
	scp -r $(src) $(win_user)@$(win_addr):$(win_dst)

tolinux:
	scp -r $(src) $(lnx_user)@$(lnx_addr):$(lnx_dst)
